<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <link type="text/css" href="#{request.contextPath}/UI/epss/epss.css" rel="stylesheet"/>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
            function actSelect(obj) {
                var pkid=obj;
                var sfeature = "dialogwidth:1100px;dialogheight:600px;center:yes;location:no;help:no;resizable:no;scroll:yes;status:no";
                var arg = new Object();
                arg.doType = "select";
                var rtn =dialog("../item/itemQry_TkcttEngMeaStl.xhtml?strEsInitStlSubcttEng="+pkid+"",arg,sfeature);
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <h:form id="form" enctype="multipart/form-data">
            <p:growl id="msgs" showDetail="true"/>
            <p:focus for="id"/>
            <p:panel>
                <h:panelGrid id="pdQry" columns="3" style="width: 100%">
                    <h:panelGrid columns="8">
                        <p:outputLabel value="结算编号：" for="id" />
                        <p:inputText id="id" value="#{esInitTkcttStlMeaAction.progInfoShowQry.id}"/>
                        <p:outputLabel value="总包合同：" for="tkcttPkid" />
                        <p:selectOneMenu id="tkcttPkid" value="#{esInitTkcttStlMeaAction.progInfoShowQry.stlPkid}">
                            <f:selectItems value="#{esInitTkcttStlMeaAction.tkcttList}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="期数编码：" for="periodNo"/>
                        <p:inputText id="periodNo" value="#{esInitTkcttStlMeaAction.progInfoShowQry.periodNo}"
                                     onclick="WdatePicker({dateFmt:'yyyyMM'})"/>
                    </h:panelGrid>
                    <h:panelGrid columns="3">
                        <p:commandButton id="qryBtn" value="查询"
                                         action="#{esInitTkcttStlMeaAction.onQueryAction('DoubleCheck','true')}"
                                         update="pdt,msgs,pgCondition">
                        </p:commandButton>
                        <p:commandButton id="resetBtn" value="重置"
                                         type="reset"
                                         update="pdQry,msgs">
                        </p:commandButton>
                        <p:ajaxStatus style="width:16px;height:16px;">
                            <f:facet name="start">
                                <h:graphicImage value="/images/ajaxloading.gif"/>
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value=""/>
                            </f:facet>
                        </p:ajaxStatus>
                    </h:panelGrid>
                </h:panelGrid>
            </p:panel>
            <h:panelGrid id="pgCondition" columns="3">
                <p:commandButton id="checkPassBtn" value="复核通过"
                                 action="#{esInitTkcttStlMeaAction.onClickForPowerAction('DoubleCheckPass')}"
                                 update="pgCondition,pdt,msgs"
                                 rendered="#{esInitTkcttStlMeaAction.rowSelectedFlag}">
                </p:commandButton>
                <p:commandButton id="checkFailBtn" value="复核未过至状态:"
                                 action="#{esInitTkcttStlMeaAction.onClickForPowerAction('DoubleCheckFail')}"
                                 update="pgCondition,pdt,msgs"
                                 rendered="#{esInitTkcttStlMeaAction.rowSelectedFlag}">
                </p:commandButton>
                <p:selectOneMenu id="statusFlag" value="#{esInitTkcttStlMeaAction.strNotPassToStatus}"
                                 rendered="#{esInitTkcttStlMeaAction.rowSelectedFlag}">
                    <f:selectItems value="#{esFlowControl.statusFlagList}"/>
                </p:selectOneMenu>
            </h:panelGrid>
            <!--列表维护-->
            <p:contextMenu for="pdt">
                <p:menuitem value="浏览" icon="ui-icon-search"
                            actionListener="#{esInitTkcttStlMeaAction.selectRecordAction('Qry','')}"
                            update="pgView,pdt,msgs,pgCondition"
                            onclick="PF('wVDlgView').show()">
                </p:menuitem>
                <p:menuitem value="选择" icon="ui-icon-plus"
                            actionListener="#{esInitTkcttStlMeaAction.selectRecordAction('DoubleCheck','')}"
                            update="pdt,msgs,pgCondition">
                </p:menuitem>
                <p:menuitem value="详细内容" icon="ui-icon-search"
                            oncomplete="actSelect(DtInitSubcttList.selection)">
                </p:menuitem>
            </p:contextMenu>
            <p:dataTable id="pdt" style="width:100%;"
                         value="#{esInitTkcttStlMeaAction.progInfoShowList}"
                         var="record"
                         rowKey="#{record.pkid}"
                         selection="#{esInitTkcttStlMeaAction.progInfoShowSelected}"
                         selectionMode="single"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks}
                         {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         paginator="true"
                         paginatorPosition="bottom"
                         rows="15"
                         rowIndexVar="row"
                         rowsPerPageTemplate="500,200,100,45,30,15"
                         emptyMessage="数据记录为空..."
                         widgetVar="DtInitSubcttList"
                         rowStyleClass="#{record.statusFlag eq '1'? null :'rowDoneStyle'}"
                         scrollable="true">
                <p:column headerText="序号" style="width:30px">
                    <h:outputText value="#{row + 1}"/>
                </p:column>
                <p:column headerText="结算编号" style="width:120px;text-align:center">
                    <h:outputText value="#{record.id}"/>
                </p:column>
                <p:column headerText="分包合同" style="width:400px;text-align:left">
                    <h:outputText value="#{record.stlName}"/>
                </p:column>
                <p:column headerText="期数编码" style="width:60px;text-align:center">
                    <h:outputText value="#{record.periodNo}"/>
                </p:column>
                <p:column headerText="状态" style="width:66px;text-align:center">
                    <h:outputText value="#{esFlowControl.getLabelByValueInStatusFlaglist(record.statusFlag)}"/>
                </p:column>
                <p:column headerText="原因" style="width:66px;text-align:center">
                    <h:outputText value="#{esFlowControl.getLabelByValueInPreStatusFlaglist(record.preStatusFlag)}"/>
                </p:column>
            </p:dataTable>
            <p:dialog id="dlgView" header="总包数量计量维护" widgetVar="wVDlgView"
                      resizable="false" modal="true"
                      showEffect="clip" hideEffect="fold">
                <h:panelGrid id="pgView">
                    <h:panelGrid columns="2">
                        <p:outputLabel value="结算编号：" for="idForDlg"/>
                        <p:inputText id="idForDlg" value="#{esInitTkcttStlMeaAction.progInfoShowSel.id}"
                                     readonly="true"
                                     style="background-color:gainsboro"/>
                    </h:panelGrid>
                    <h:panelGrid columns="2">
                        <p:outputLabel value="总包合同：" for="tkcttPkidForDlg"/>
                        <p:inputText id="tkcttPkidForDlg" value="#{esInitTkcttStlMeaAction.progInfoShowSel.stlName}"
                                     readonly="true"
                                     style="background-color:gainsboro;width:328px"/>
                    </h:panelGrid>
                    <h:panelGrid columns="4">
                        <p:outputLabel value="期数编码：" for="periodNoForDlg"/>
                        <p:inputText id="periodNoForDlg" value="#{esInitTkcttStlMeaAction.progInfoShowSel.periodNo}"
                                     readonly="true"
                                     style="background-color:gainsboro"/>
                        <p:outputLabel value="备注内容：" for="noteForDlg"/>
                        <p:inputText id="noteForDlg" value="#{esInitTkcttStlMeaAction.progInfoShowSel.note}"
                                     readonly="true"
                                     style="background-color:gainsboro"/>
                    </h:panelGrid>
                    <h:panelGrid columns="4">
                        <p:outputLabel for="createdByNameSel" value="创建人：" />
                        <h:inputText id="createdByNameSel"
                                     value="#{esInitTkcttStlMeaAction.progInfoShowSel.createdByName}"
                                     style="background-color:gainsboro" readonly="true"/>
                        <p:outputLabel for="createdDateSel" value="创建时间：" />
                        <h:inputText id="createdDateSel"
                                     value="#{esInitTkcttStlMeaAction.progInfoShowSel.createdDate}"
                                     style="background-color:gainsboro" readonly="true"/>
                        <p:outputLabel for="lastUpdByNameSel" value="修改人：" />
                        <h:inputText id="lastUpdByNameSel"
                                     value="#{esInitTkcttStlMeaAction.progInfoShowSel.lastUpdByName}"
                                     style="background-color:gainsboro" readonly="true"/>
                        <p:outputLabel for="lastUpdDateSel" value="修改时间：" />
                        <h:inputText id="lastUpdDateSel"
                                     value="#{esInitTkcttStlMeaAction.progInfoShowSel.lastUpdDate}"
                                     style="background-color:gainsboro" readonly="true"/>
                        <p:outputLabel for="modificationNumSel" value="修改次数：" />
                        <h:inputText id="modificationNumSel"
                                     value="#{esInitTkcttStlMeaAction.progInfoShowSel.modificationNum}"
                                     style="background-color:gainsboro;text-align:right;" readonly="true">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0"/>
                        </h:inputText>
                    </h:panelGrid>
                </h:panelGrid>
            </p:dialog>
        </h:form>
    </ui:define>
</ui:composition>